package com.example.sport.service.impl;

import com.example.sport.domain.Event;
import com.example.sport.mapper.EventMapper;
import com.example.sport.service.EventService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class EventServiceImpl implements EventService {
    @Autowired
    private EventMapper eventMapper;

    @Override
    public List<Event> getEventByEventName(String eventName) {

        return eventMapper.selectListByCollegeName(eventName);
    }

    @Override
    public int updateEvent(Event event) {
       return eventMapper.updateById(event);
    }

    @Override
    public int addEvent(Event event) {
        return eventMapper.insert(event);
    }

    @Override
    public int deleteEventById(String eventId) {
        return eventMapper.deleteById(eventId);
    }

    @Override
    public Event getEventInfoById(String id) {
        return eventMapper.selectById(id);
    }


}
